/*
    app 入口模块
*/ 
var fs=require('fs')


var express=require('express')
var app=express()
app.set('views','./views')

app.engine('html',require('express-art-template'))
 
var bodyParser=require('body-parser')
app.use(bodyParser.urlencoded({extended:false}))
app.use(bodyParser.json())

var router=require('./router')
app.use(router)//router.js 里面居然能用res.render 只要挂载router     在bodyparser的配置之后就可以

app.use('/node_modules/',express.static('./node_modules'))
app.use('/public',express.static('./public'))
// var path=require('path')
// app.use(express.static(path.join(__dirname, './public')));
// app.use(express.static(__dirname + '/public'));

// app.use('/public/',express.static('./public/')) 

app.listen(3000,function(){
    console.log('running..')
})